const Joi = require("joi");

module.exports = {
    login: {
        body: {
            account: Joi.string().alphanum().min(3).max(12).required(),
            password: Joi.string().pattern(/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z\d!_@#$%^&*]{6,12}$/).required(),
            email: Joi.string().email().required(),
        }
    },
    getEmailCode: {
        body: {
            account: Joi.string().alphanum().min(3).max(12).required(),
            email: Joi.string().email().required(),
        }
    },
    verifyEmailCode: {
        body: {
            account: Joi.string().alphanum().min(3).max(12).required(),
            email: Joi.string().email().required(),
            code: Joi.string().pattern(/^[0-9]{6}/).required(),
        }
    },
    updatePassword: {
        body: {
            password: Joi.string().pattern(/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*])[a-zA-Z\d!_@#$%^&*]{6,12}$/).required(),
            confirmPassword: Joi.ref("password"),
            account: Joi.string().alphanum().min(3).max(12),
        }
    }
}